import React, { Component } from 'react'

export default class App extends Component {
  state={
    todoList:['1','2']
  }
  printTitle(){
    if(this.state.todoList.length==0){
      return (<p>您当前暂无待办事项</p>)
    }else{
      return (<p>你当前有{this.state.todoList.length}条待办事项</p>)
    }
  }
  render() {
    return (
      <div>
        {this.printTitle() }
      </div>
    )
  }
}
